package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.OaWorkPlan;
import com.ruoyi.system.mapper.OaWorkPlanMapper;
import com.ruoyi.system.service.IOaWorkPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工作计划服务实现类
 *
 * @author 自定义
 * @date 2025-04-21
 */
@Service
public class OaWorkPlanServiceImpl implements IOaWorkPlanService {

    @Autowired
    private OaWorkPlanMapper oaWorkPlanMapper;

    @Override
    public OaWorkPlan selectOaWorkPlanById(Long id) {
        return oaWorkPlanMapper.selectOaWorkPlanById(id);
    }

    @Override
    public List<OaWorkPlan> selectOaWorkPlanList(OaWorkPlan oaWorkPlan) {
        return oaWorkPlanMapper.selectOaWorkPlanList(oaWorkPlan);
    }

    @Override
    public int insertOaWorkPlan(OaWorkPlan oaWorkPlan) {
        int rows = oaWorkPlanMapper.insertOaWorkPlan(oaWorkPlan);
        System.out.println("插入后工作计划的 id: " + oaWorkPlan.getId());
        return rows;
    }

    @Override
    public int updateOaWorkPlan(OaWorkPlan oaWorkPlan) {
        return oaWorkPlanMapper.updateOaWorkPlan(oaWorkPlan);
    }

    @Override
    public int deleteOaWorkPlanById(Long id) {
        return oaWorkPlanMapper.deleteOaWorkPlanById(id);
    }

    @Override
    public int deleteOaWorkPlanByIds(Long[] ids) {
        return oaWorkPlanMapper.deleteOaWorkPlanByIds(ids);
    }

    @Override
    public List<OaWorkPlan> selectOaWorkPlanListByUserId(Long userId) {
        return oaWorkPlanMapper.selectOaWorkPlanListByUserId(userId);
    }
}